allow $1 $2:shadow enable;
allow $1 $2:mmu { map_read map_write adjust memorymap physmap pinpage mmuext_op };
allow $1 $2:grant setup;
- allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute sethvmc setparam pcilevel trackdirtyvram };
+ allow $1 $2:hvm { cacheattr getparam hvmctl irqlevel pciroute sethvmc
+ setparam pcilevel trackdirtyvram nested };
')
# create_domain(priv, target)
rc = -EINVAL;
break;
case HVM_PARAM_NESTEDHVM:
- if ( !IS_PRIV(current->domain) )
- {
- rc = -EPERM;
+ rc = xsm_hvm_param_nested(XSM_PRIV, d);
+ if ( rc )
break;
- }
if ( a.value > 1 )
rc = -EINVAL;
/* Remove the check below once we have
return xsm_default_action(action, current->domain, d);
}
+static XSM_INLINE int xsm_hvm_param_nested(XSM_DEFAULT_ARG struct domain *d)
+{
+ XSM_ASSERT_ACTION(XSM_PRIV);
+ return xsm_default_action(action, current->domain, d);
+}
+
#ifdef CONFIG_X86
static XSM_INLINE int xsm_shadow_control(XSM_DEFAULT_ARG struct domain *d, uint32_t op)
{
long (*do_xsm_op) (XEN_GUEST_HANDLE_PARAM(xsm_op_t) op);
int (*hvm_param) (struct domain *d, unsigned long op);
+ int (*hvm_param_nested) (struct domain *d);
#ifdef CONFIG_X86
int (*shadow_control) (struct domain *d, uint32_t op);
return xsm_ops->hvm_param(d, op);
}
+static inline int xsm_hvm_param_nested (xsm_default_t def, struct domain *d)
+{
+ return xsm_ops->hvm_param_nested(d);
+}
+
#ifdef CONFIG_X86
static inline int xsm_shadow_control (xsm_default_t def, struct domain *d, uint32_t op)
{
set_to_dummy_if_null(ops, tmem_op);
set_to_dummy_if_null(ops, tmem_control);
set_to_dummy_if_null(ops, hvm_param);
+ set_to_dummy_if_null(ops, hvm_param_nested);
set_to_dummy_if_null(ops, do_xsm_op);
return current_has_perm(d, SECCLASS_HVM, perm);
}
+static int flask_hvm_param_nested(struct domain *d)
+{
+ return current_has_perm(d, SECCLASS_HVM, HVM__NESTED);
+}
+
#ifdef CONFIG_X86
static int flask_shadow_control(struct domain *d, uint32_t op)
{
.tmem_op = flask_tmem_op,
.tmem_control = flask_tmem_control,
.hvm_param = flask_hvm_param,
+ .hvm_param_nested = flask_hvm_param_nested,
.do_xsm_op = do_flask_op,
# source = domain whose memory is being shared
# target = client domain
share_mem
+# HVMOP_set_param setting HVM_PARAM_NESTEDHVM
+ nested
}
# Class event describes event channels. Interdomain event channels have their